package com.example.springboot.service;

import com.example.springboot.entity.announcements;
import com.example.springboot.mapper.AmaMangerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AmaMangerService {

    @Autowired
    private AmaMangerMapper announcementsMapper;

    public List<announcements> findAll() {
        return announcementsMapper.findAll();
    }

    public void addAnnouncement(announcements announcement) {
        announcementsMapper.addAnnouncement(announcement);
    }

    public void editAnnouncement(announcements announcement) {
        announcementsMapper.editAnnouncement(announcement);
    }

    public void deleteAnnouncement(int announcement_id) {
        announcementsMapper.deleteAnnouncement(announcement_id);
    }

    public void deleteAnnouncementBatch(List<Long> ids) {
        announcementsMapper.deleteAnnouncementBatch(ids);
    }

    public List<announcements>  selectByTitle(String title) {
        return announcementsMapper.selectByTitle(title);
    }
}
